import React, { Component } from 'react';

import './App.css';
import ListItem from './components/listItem';
// import ListItem from './components/listItemFunc';
import ItemA from './components/hoc/itemA';
import ItemC from './components/rp/itemC';
const listData = [
  {
    id: 1,
    name: '液晶电视',
    price: 1000,
    stock: 11
  },
  {
    id: 2,
    name: '液晶电视2',
    price: 2000,
    stock: 12
  },
  {
    id: 3,
    name: '液晶电视3',
    price: 3000,
    stock: 13
  },
  {
    id: 4,
    name: '液晶电视4',
    price: 4000,
    stock: 14
  }
]



class App extends Component {
  constructor(props) {
    super(props);
    this.state = {}
  }
  state = {}
  renderList() {
    if (listData.length === 0) {
      return <div className='text-center'>购物车为空</div>
    } else {
      return listData.map((item, idx) => {
        return <ListItem key={idx} data={item}></ListItem>
      })
    }
  }
  render() {
    return (
      <>
        <div className='container'>
          {listData.map(item => {
            return <ListItem key={item.id} data={item}></ListItem>
          })}
        </div>
        <ItemA></ItemA>
        <ItemC></ItemC>
      </>
    );
  }
}
export default App;
